package com.yanqu.road.entity.cricket.config;

import com.yanqu.road.utils.string.StringUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * 蛐蛐表
 */
public class CricketConfig {

    /**
     * 蛐蛐id
     */
    private int id;

    /**
     * 品质
     */
    private int quality;

    /**
     * 血、攻、气对应的资质
     */
    private String talent;

    /**
     * 初始军衔|等级
     */
    private String beginTitle;

    /**
     * 攻击技能方式列表
     */
    private String attackSkills;

    /**
     * 初始技能列表
     */
    private String skills;

    /**
     * 职业
     */
    private int occupation;

    /**
     * 虫师技能id
     */
    private int partonSkill;

    //获得的时候获得的缘分值大小
    private String relationPoint;

    /**
     * 通用技能
     */
    private String equipSkills;

    /**
     * 是否可以被老友事件抽中
     */
    private int getByEvent;


    public CricketConfig() {

    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getQuality() {
        return quality;
    }

    public void setQuality(int quality) {
        this.quality = quality;
    }

    public String getBeginTitle() {
        return beginTitle;
    }

    public void setBeginTitle(String beginTitle) {
        this.beginTitle = beginTitle;
    }

    public String getTalent() {
        return talent;
    }

    public void setTalent(String talent) {
        this.talent = talent;
    }

    public String getSkills() {
        return skills;
    }

    public void setSkills(String skills) {
        this.skills = skills;
    }

    public int getOccupation() {
        return occupation;
    }

    public void setOccupation(int occupation) {
        this.occupation = occupation;
    }

    public int getPartonSkill() {
        return partonSkill;
    }

    public void setPartonSkill(int partonSkill) {
        this.partonSkill = partonSkill;
    }

    public String getAttackSkills() {
        return attackSkills;
    }

    public void setAttackSkills(String attackSkills) {
        this.attackSkills = attackSkills;
    }

    /**
     * 攻击技能方式列表
     */
    public List<Integer> getAttackSkillList() {
        List<Integer> result = new ArrayList<>();
        if (StringUtils.isNullOrEmpty(attackSkills)) {
            return new ArrayList<>();
        } else {
            List<String> list = StringUtils.stringToStringList(attackSkills, "\\|");
            for (String skillParam : list) {
                String[] split = skillParam.split(";");
                if (split.length == 0) {
                    continue;
                }
                result.add(Integer.valueOf(split[0]));
            }
            return result;
        }
    }

    /**
     * 初始技能列表
     */
    public List<Integer> getInitSkillList() {
        if (StringUtils.isNullOrEmpty(skills)) {
            return new ArrayList<>();
        } else {
            return new ArrayList<>(StringUtils.stringToIntegerList(skills, "\\|"));
        }
    }

    public String getRelationPoint() {
        return relationPoint;
    }

    public void setRelationPoint(String relationPoint) {
        this.relationPoint = relationPoint;
    }

    public void setEquipSkills(String equipSkills) {
        this.equipSkills = equipSkills;
    }



    public List<Integer> getEquipSkillList() {
        if (StringUtils.isNullOrEmpty(equipSkills)) {
            return new ArrayList<>();
        } else {
            return new ArrayList<>(StringUtils.stringToIntegerList(equipSkills, "\\|"));
        }
    }

    public int getGetByEvent() {
        return getByEvent;
    }

    public void setGetByEvent(int getByEvent) {
        this.getByEvent = getByEvent;
    }
}
